package com.spsoft.vatoutinv.controller.statistics;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.spsoft.core.annotation.AnonymousAccess;
import com.spsoft.core.annotation.Log;
import com.spsoft.core.controller.BaseController;
import com.spsoft.core.enums.LogActionType;
import com.spsoft.core.enums.LogMenuEnum;
import com.spsoft.core.model.Result;
import com.spsoft.vatoutinv.model.dto.statistics.InvoiceInfoDto;
import com.spsoft.vatoutinv.model.vo.statistics.InvoiceInfoVo;
import com.spsoft.vatoutinv.service.vmsfulloutinvoice.VmsFullOutInvoiceDetailsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangy
 * @date 2024/6/19 11:23
 */
@Api(tags = {"统计相关"})
@RequiredArgsConstructor
@Validated
@Slf4j
@RestController
@RequestMapping("/statistics")
public class VmsStatisticsController extends BaseController {

    private final VmsFullOutInvoiceDetailsService fullOutInvoiceDetailsService;

    /**
     * 发票信息统计
     */
    @ApiOperation("统计相关-发票信息统计")
    @AnonymousAccess(value = "/invoiceInformation", method = RequestMethod.POST, permissionCode = "")
    @Log(value = "统计相关-发票信息统计", type = LogActionType.SELECT, menuName = LogMenuEnum.STATISTICS)
    public Result<IPage<InvoiceInfoVo>> invoiceInformation(@RequestBody @Validated InvoiceInfoDto invoiceInfoDto) {
        return Result.OK(fullOutInvoiceDetailsService.queryInvoiceInfoStatistics(invoiceInfoDto));
    }


}
